<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<script type="text/javascript">
	$(function() {
		validReg("addForm");
	});
</script>
<c:if test="${!empty userModel.powerMap.WORK_SET }">
<div class="panel_custom">	
	<div class="topTitle">工作日查询设置</div>
	<div class="timeSet">
		<form id="updateWorkTimeForm" class="form-horizontal" role="form"
			onsubmit="return false;">

			<div class="form-group">
				<label class="col-sm-2 control-label">&nbsp;</label>
				<div class="col-sm-10 timesp">
					<span>开始时间</span> <span>结束时间</span>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">人行查询时间：</label>
				<div class="col-sm-10 ">
					<input id="bankUpTimeInput" type="text" class="form-control"
						placeholder="08:00"
						onblur="work.regWorkTime('bankUpTimeInput','bankUpTimeSpan')">
					<span>—</span> <input id="bankDownTimeInput" type="text"
						class="form-control" placeholder="08:00"
						onblur="work.regWorkTime('bankDownTimeInput','bankDownTimeSpan')">
					<span id="bankUpTimeSpan" style="color: #F00"></span><span>&nbsp;</span><span
						id="bankDownTimeSpan" style="color: #F00"></span>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-2 control-label">机构查询时间：</label>
				<div class="col-sm-10 ">
					<input id="corpUpTimeInput" type="text" class="form-control"
						placeholder="08:00"
						onblur="work.regWorkTime('corpUpTimeInput','corpUpTimeSpan')">
					<span>—</span> <input id="corpDownTimeInput" type="text"
						class="form-control" placeholder="08:00"
						onblur="work.regWorkTime('corpDownTimeInput','corpDownTimeSpan')">
					<span id="corpUpTimeSpan" style="color: #F00"></span><span>&nbsp;</span><span
						id="corpDownTimeSpan" style="color: #F00"></span>
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-2"></div>
				<div class="col-sm-3">
					<button class="a-btn1  text-center"
						onclick="validateCallback(this, work.updateWorkTime());">确定</button>
				</div>
			</div>

		</form>
	</div>
	<div class="clearfix"></div>
</div>
</c:if>
<div class="clearfix"></div>
<div class="panel_custom">
	<div class="topTitle">工作日视图</div>
	<div class="timeBox">
		<div class="timeTop">
			<a href="javascript:void(0);" onclick="work.prevYear()"><span
				class="prevMonth"></span> </a> <a href="javascript:void(0);"
				onclick="work.prevMonth()"><span class="prevDate"></span></a> <span
				class="curDate"> <b id="bYear"></b>年 <b id="bMonth"></b>月
			</span> <a href="javascript:void(0);" onclick="work.nextMonth()"><span
				class="nextDate"></span></a> <a href="javascript:void(0);"
				onclick="work.nextYear()"><span class="nextMonth"></span> </a>
		</div>

		<div class="timeTablePanel">
			<div class="timeTableTop">
				<span>星期日</span> <span>星期一</span> <span>星期二</span> <span>星期三</span>
				<span>星期四</span> <span>星期五</span> <span>星期六</span>
			</div>

			<table id="whriteTable" class="timeTable" border="0" cellspacing="0"
				cellpadding="0">
				<c:forEach items="${result.data.rows}" var="row">
					<c:if test="${row.week=='7'}">
						<tr>
					</c:if>

				    <td <c:if test="${row.isWork=='0'}">class="weekDay"</c:if> >
						<div class="dayTxt">
							<span class="date"><fmt:formatDate value="${row.day }" pattern="yyyy-MM-dd" />
							</span>
						</div>
						<c:if test="${!empty userModel.powerMap.WORK_SET }">
							<div>						 
							  <a href="javascript:work.setWork('${row.id }', ${row.isWork });" class="dayTxt" >
							       <c:if test="${row.isWork eq '0'}">设置为工作日</c:if>
							       <c:if test="${row.isWork eq '1'}">设置为非工作日</c:if>
							  </a>
							</div>
						</c:if>	
						<c:if test="${!empty userModel.powerMap.WORK_ADD }">
							<div>			
							  <a href="javascript:work.clickColumn('<fmt:formatDate value="${row.day }" pattern="yyyy年MM月dd日" />', ${row.isWork});" class="dayTxt">加班申请</a>
							</div>
						</c:if>
					</td>
				
					  
					
					<c:if test="${row.week=='6'}"> </tr> </c:if>
				</c:forEach>
			</table>

			<div class="timeModel" id="editDate">
			   
				<div class="modelTop">
					<span class="titleModel"><div id="formDate"></div></span> 
					  <a	href="javascript:void(0);" onclick="work.closeModel('editDate')"><span
						class="closeModel"></span> </a>
				</div>
             
                
				<div class="modelContent">

					<form id="addForm" class="form-horizontal" role="form"
						onsubmit="return validateCallback(this, work.workadd);">
						<div class="panel timeSetModel">
							<div class="form-group">
								<label class="col-sm-5 control-label">指定可查询部门：</label>
								<div class="col-sm-7">
									<select class="form-control input-sm" name="deptId" id="deptId"
										onchange="work.getUserByDept('deptId','workUserId')"></select>
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-5 control-label">指定可查询用户：</label>
								<div class="col-sm-7">
									<select name="workUserId" id="workUserId" class="form-control input-sm"></select>
									<span id="promMessage"></span>
								</div>
							</div>


							<div class="form-group">
								<label class="col-sm-5 control-label">加班时间：</label>
								<div class="col-sm-7">
									<input type="text" id="onTime" name="onTime"
										class="form-control" placeholder="08:00" style="width: 90px;"
										pattern="^([01]\d|2[0123])(:|：)([0-5]\d)$" data-bv-regexp-message="开始时间格式不正确" required data-bv-notempty> <span>-</span> <input
										id="offTime" name="offTime" type="text" class="form-control"
										placeholder="08:00" style="width: 90px;"
										pattern="^([01]\d|2[0123])(:|：)([0-5]\d)$" data-bv-regexp-message="结束时间格式不正确" required data-bv-notempty>

								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-5 control-label">备注：</label>
								<div class="col-sm-7" >
									<textarea name="note" id="note" style="width:200px"></textarea>
								</div>
							</div>
							
						</div>
						<div class="form-group">
							<label class="col-sm-5 control-label">&nbsp;</label>
							<div class="col-sm-7">

							   <button class="a-btn1  text-center" type="submit"   class="a-btn1">确定</button>
							</div>
						</div>

					</form>
				</div>

			</div>
		</div>

	</div>
</div>

<div class="clearfix"></div>